<template>
  <div class="card-box">
    <v-dialog :show.sync="dialogVisible" @beforeClose="beforeClose" width="80%" title="新增使用单位">
      <div v-if="dialogVisible">
        <div class="card-box">
          {{formObj.applyUnit.sort}}
          <div class="card-title">基本信息</div>
          <el-form class="form-wrap" size="small" label-width="150px" ref="ruleForm" :model="formObj" :rules="rules">
            <el-form-item label="单位名称" prop="applyUnit.unitName">
              <el-input v-model="formObj.applyUnit.unitName" placeholder="请输入单位名称" maxlength="30"></el-input>
            </el-form-item>
            <el-form-item label="单位类型" prop="applyUnit.unitType">
              <el-select v-model="formObj.applyUnit.unitType" placeholder="请选择单位类型">
                <el-option v-for="item in lists" :key="item.value" :label="item.label" :value="item.value"></el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="联系人姓名" prop="applyUnit.userName">
              <el-input v-model="formObj.applyUnit.userName" placeholder="请输入联系人姓名" maxlength="20"></el-input>
            </el-form-item>
            <el-form-item label="联系人手机" prop="applyUnit.tell">
              <el-input v-model="formObj.applyUnit.tell" placeholder="请输入联系人手机" maxlength="13" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
            </el-form-item>
            <el-form-item label="社会统一信用代码证" prop="applyUnit.creditNumber">
              <el-input v-model="formObj.applyUnit.creditNumber" placeholder="请输入社会统一信用代码证" maxlength="30"></el-input>
            </el-form-item>
            <el-form-item label="排序号" prop="applyUnit.sort">
              <el-input v-model="formObj.applyUnit.sort" placeholder="请输入排序号" maxlength="4" oninput="value=value.replace(/[^\d]/g,'')"></el-input>
            </el-form-item>
            <el-form-item label="备注" class="full">
              <el-input v-model="formObj.applyUnit.remarks" placeholder="请输入备注" maxlength="200"></el-input>
            </el-form-item>
            <el-form-item label="附件" class="col-two">
              <v-upload
                type="file"
                :busId="formObj.applyUnit.apUiId"
                modelType="apply-unit"
                ref="unitFileUpload"
                @onSuccess="saveEntity"
                :isView="false"
                :propsFileList="formObj.fileList"
              ></v-upload>
            </el-form-item>

            <el-form-item class="text-right"></el-form-item>
          </el-form>
        </div>
      </div>
      <div slot="foot">
        <el-button type="primary" size="small" @click="dialogVisible = false" style="width: 80px">取 消</el-button>
        <el-button type="primary" size="small" @click="resetForm()" style="width: 80px">重置</el-button>
        <el-button type="primary" size="small" v-throttle="[sendData]" style="width: 80px">保存</el-button>
      </div>
    </v-dialog>
  </div>
</template>

<script src="./unit-add.js">
</script>


<style scoped lang='scss'>
@include formWrap();
</style>
